<template>
  <div />
</template>

<script>
export default {
  layout: 'blank',
  name: 'Exit',
  middleware: async (ctx) => {
    const { status, data } = await ctx.$axios.get('/user/logout')
    if (status === 200 && data.code === 0) {
      ctx.store.commit('user/setUser', { hasUser: false })
      return ctx.redirect('/')
    }
  }
}
</script>

<style scoped></style>
